package com.sskj.zixun.http;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.request.PostRequest;
import com.sskj.common.base.HttpData;
import com.sskj.lib.bean.PageBean;
import com.sskj.zixun.bean.Banner;
import com.sskj.zixun.bean.Notice;
import com.sskj.zixun.bean.NoticeList;
import com.sskj.zixun.bean.PlatFormInfoBean;

import java.util.List;

/**
 * 作者 :吕志豪
 * 简书：https://www.jianshu.com/u/6e525b929aac
 * github：https://github.com/lvzhihao100
 * 描述：
 * 创建时间：2018-10-15 14:08
 */
public class HttpService implements IHttpService {

    @Override
    public PostRequest<HttpData<List<NoticeList>>> getGGList(int p) {
        return OkGo.<HttpData<List<NoticeList>>>post(HttpConfig.BASE_URL + HttpConfig.NOTICE)
                .params("p", p)
                .params("size", 10);
    }

    @Override
    public PostRequest<HttpData<Notice>> ggDetail(String id) {
        return OkGo.<HttpData<Notice>>post(HttpConfig.BASE_URL + HttpConfig.NOTICEDETAIL)
                .params("id", id);
    }

    @Override
    public PostRequest<HttpData<PlatFormInfoBean>> getZiXunList(int page, int pageSize) {
        return OkGo.<HttpData<PlatFormInfoBean>>post(HttpConfig.BASE_URL + HttpConfig.ZIXUNLIST)
                .params("page", page)
                .params("pageSize", pageSize);
    }

    @Override
    public PostRequest<HttpData<Banner>> getBannerZixun() {
        return OkGo.<HttpData<Banner>>post(HttpConfig.BASE_URL + HttpConfig.ZIXUNBANNERLIST)
                .params("type", 12);
    }

    @Override
    public PostRequest<HttpData<PlatFormInfoBean.InfoBean>> getZixunDetail(int id) {
        return OkGo.<HttpData<PlatFormInfoBean.InfoBean>>post(HttpConfig.BASE_URL + HttpConfig.ZIXUNDETAIL)
                .params("id", id);
    }


}